//import request from '@/utils/request'
import http from '@/api/request'

const api = {
	// 查询字典数据列表
	listData(query) {
		return http({
			url: '/tug-api/system/dict/data/list',
			method: 'get',
			params: query
		})
	}

	// 查询字典数据详细
	getData(dictCode) {
		return http({
			url: '/tug-api/system/dict/data/' + dictCode,
			method: 'get'
		})
	}

	// 根据字典类型查询字典数据信息
	getDicts(dictType) {
		return http({
			url: '/tug-api/system/dict/data/type/' + dictType,
			method: 'get'
		})
	}

	// 新增字典数据
	addData(data) {
		return http({
			url: '/tug-api/system/dict/data',
			method: 'post',
			data: data
		})
	}

	// 修改字典数据
	updateData(data) {
		return http({
			url: '/tug-api/system/dict/data',
			method: 'put',
			data: data
		})
	}

	// 删除字典数据
	delData(dictCode) {
		return http({
			url: '/tug-api/system/dict/data/' + dictCode,
			method: 'delete'
		})
	}

}

export default api